package com.sailorj.itools.action;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;
import com.sailorj.itools.constants.MyState;
import com.sailorj.itools.constants.StorageConfig;
import com.sailorj.itools.utils.Logger;

public class TranslateClearAction extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent event) {
        //获取编辑器
        Editor mEditor = event.getData(PlatformDataKeys.EDITOR);
        if (mEditor == null) {
            Logger.info("编辑器获取失败");
            return;
        }
        MyState.getInstance().setConfig(new StorageConfig());
        Logger.showPopupWindow(mEditor, "百度翻译配置重置成功！");
    }

}
